package com.mall.app.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mall.app.bean.TbCart;
import com.mall.app.dao.TbCartMapper;
import com.mall.app.service.TbCartService;

/**
 * <p>
 * 购物车表 服务实现类
 * </p>
 *
 * @author LeeSin
 * @since 2020-07-10
 */
@Service
@Transactional
public class TbCartServiceImpl extends ServiceImpl<TbCartMapper, TbCart> implements TbCartService 
{
	@Autowired
	private TbCartMapper cartMapper;

	@Override
	public List<TbCart> listPageCart(Map<String, Object> map)
	{
		// TODO Auto-generated method stub
		return cartMapper.listPageCart(map);
	}

	@Override
	public List<TbCart> listCart(Map<String, Object> map)
	{
		// TODO Auto-generated method stub
		return cartMapper.listCart(map);
	}

	@Override
	public int getCount(Map<String, Object> map)
	{
		// TODO Auto-generated method stub
		return cartMapper.getCount(map);
	}

	@Override
	public boolean removeBatchCarts(String[] cartIds)
	{
		// TODO Auto-generated method stub
		return cartMapper.removeBatchCarts(cartIds) > 0;
	}

	@Override
	public boolean updateCart(TbCart cart)
	{
		// TODO Auto-generated method stub
		return cartMapper.updateCart(cart) > 0;
	}

	@Override
	public boolean insertCart(TbCart cart)
	{
		// TODO Auto-generated method stub
		return cartMapper.insertCart(cart) > 0;
	}

}
